package de.baumann.browser.present

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.JoinApp
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.IRequestJoinView
import de.baumann.browser.model.NodeModel

class RequestJoinPresenter : BasePresenter<IRequestJoinView>() {
    fun requestJoinList() {
        NodeModel().requestJoinList(view.getNodeId())
                .subscribe(object : OdinObserver<List<JoinApp>>(view) {
                    override fun onSuccess(data: List<JoinApp>?) {
                        if (view != null) {
                            view.setJoinAppList(data)
                        }
                    }
                })
    }
}